package com.hm.oltu.service;

public interface OAuthService {

	/**
	 * 添加 auth code
	 * 
	 * @param authCode
	 * @param username
	 */
	void addAuthCode(String authCode, String username);

	/**
	 * 添加 access token
	 * 
	 * @param accessToken
	 * @param username
	 */
	void addAccessToken(String accessToken, String username);

	/**
	 * 验证auth code是否有效
	 * 
	 * @param authCode
	 * @return
	 */
	boolean checkAuthCode(String authCode);

	/**
	 * 验证access token是否有效
	 * 
	 * @param accessToken
	 * @return
	 */
	boolean checkAccessToken(String accessToken);

	String getUsernameByAuthCode(String authCode);

	String getUsernameByAccessToken(String accessToken);

	/**
	 * auth code / access token 过期时间
	 * 
	 * @return
	 */
	long getExpireIn();

	boolean checkClientId(String clientId);

	boolean checkClientSecret(String clientSecret);
}
